package com.mzx.javase.enum_test;

/**
 * 使用自定义枚举类的测试
 */
public class SeasonTest {
    public static void main(String[] args) {
        Weather weather = new Weather();
        weather.setSeason(Season.SPRING);//限制Season的赋值

        weather.setDay(1);
        weather.setMonth(12);
        System.out.println(weather.toString());
    }


}
class Weather{
    @Override
    public String toString() {
        return "Weather{" +
                "season=" + season +
                ", day=" + day +
                ", month=" + month +
                '}';
    }

    private Season season;
    private int day;
    private int month;

    public Season getSeason() {
        return season;
    }

    public void setSeason(Season season) {
        this.season = season;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }
}
